package cn.lhf.myblog.http.result;

import cn.lhf.myblog.context.StatusCode;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.io.Serializable;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class Result {
    @JsonProperty
    private StatusCode code = StatusCode.OK;
    @JsonProperty
    private String msg;
    @JsonProperty
    private Serializable info;

    public Result setCode(StatusCode code) {
        this.code = code;
        return this;
    }

    public Result setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public Result setInfo(Serializable info) {
        this.info = info;
        return this;
    }
}
